home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / prog_disc / volume_1 / issue_11 / arc / arcdoc < prev   
Encoding:
Text File  |  1995-06-13  |  17.5 KB  |  446 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.           ************************************************************
  8.           *                                                          *
  9.           *                          Beebug                          *
  10.           *                                                          *
  11.           *                    A R C H I M E D E S                   *
  12.           *                                                          *
  13.           *                AA      RRRRRRRR      CCCCCC              *
  14.           *              AA  AA    RR      RR  CC      CC            *
  15.           *            AA      AA  RR      RR  CC                    *
  16.           *            AAAAAAAAAA  RRRRRRRR    CC                    *
  17.           *            AA      AA  RR  RR      CC                    *
  18.           *            AA      AA  RR    RR    CC      CC            *
  19.           *            AA      AA  RR      RR    CCCCCC              *
  20.           *                                                          *
  21.           *                                                          *
  22.           *                     by David Pilling                     *
  23.           *                                                          *
  24.           *                                                          *
  25.           *              This program is Public Domain               *
  26.           *                                                          *
  27.           ************************************************************
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  ******************************************************************************
  36.  *                                                                            *
  37.  *                              ARC Version Numbers                           *
  38.  *                              -------------------                           *
  39.  *                                                                            *
  40.  *                            Version 1.0 - 29/06/88                          *
  41.  *                                                                            *
  42.  *                                                                            *
  43.  *                                                                            *
  44.  *                                                                            *
  45.  *                                                                            *
  46.  *                                                                            *
  47.  *                                                                            *
  48.  *                                                                            *
  49.  *                                                                            *
  50.  *                                                                            *
  51.  *                                                                            *
  52.  *                                                                            *
  53.  *                                                                            *
  54.  *                                                                            *
  55.  *                                                                            *
  56.  *                                                                            *
  57.  *                                                                            *
  58.  ******************************************************************************
  59.  
  60. Archimedes ARC                                                          Page 2
  61.  
  62.  
  63.  
  64.                                   Contents
  65.                                   --------
  66.  
  67.  
  68.                          (1) Introduction
  69.                          (2) How to use ARC
  70.                          (3) ARC commands
  71.                          (4) Archimedes ARC file format
  72.                          (5) ARC support
  73.  
  74.  
  75.  
  76. 1. Introduction
  77. ---------------
  78. ARC is the Archimedes archive utility. An archive is a file in which many
  79. smaller files are stored. You may, using the ARC utility, create archives and
  80. add files to them (ARC'ing a file) or remove files (de-ARC'ing). One of the
  81. features of ARC, is that files are stored in a highly compressed form; thus
  82. saving disc space and allowing more rapid transfer of files by modem. However,
  83. probably the most useful feature of an archive is that like sub-directories
  84. in the ADFS, it makes keeping track of files when transferring them from one
  85. machine to another, much simpler.
  86.  
  87. Archives have a long history going back to UNIX and CP/M. An example of an
  88. archive with no compression is the UNIX shar format. Whilst on CP/M archive
  89. utilities which used data compression include squeeze, LUE and LBR. Perhaps
  90. the most well known archive format and utility is the System Enhancements
  91. Associates (SEA) ARC for the IBM PC which was based on many of these earlier
  92. programs. This has now been transferred to the Atari ST and Amiga micros. In
  93. addition, other more advanced versions of it have appeared on the PC like
  94. PKARC by Phil Katz. Beebug Archimedes ARC is fully compatible with SEA's ARC
  95. program. Using it, you can successfully unpack PC archives on your Archimedes,
  96. as well as create PC format archives. In addition, you can use a special
  97. Archimedes format archive which while not compatible with the PC, preserves
  98. Archimedes file attributes like load and exec addresses.
  99.  
  100. If you dial up your local bulletin board, you will see many ARC files (they
  101. are usually identified by the suffix .ARC). Using ARC, you will be able to
  102. transfer the files in these to your Archimedes. Obviously, you cannot use
  103. executable PC programs, but there are many text and data files which you may
  104. want to examine (such as documentation, C source files, screen images etc.).
  105.  
  106. Do not get the impression from the above, that the data compression aspect of
  107. ARC is just a side effect. Frequently, you may achieve a space saving of upto
  108. 90%. Just how much space you save, depends on the type of file being ARC'd.
  109. Text files usually compress well. Whilst PC executable files rarely compress
  110. by much, Archimedes Basic programs  seem to show good savings in space (often
  111. owing to Acorn's way of handling arrays).
  112. Archimedes ARC                                                          Page 3
  113.  
  114.  
  115.  
  116. 2. How to use ARC
  117. -----------------
  118. Archimedes ARC consists of two files: the program ARC, and ARC_DOC containing
  119. this text. You use ARC by typing *arc followed by a number of parameters. If
  120. you type *arc on its own without parameters, a page of help information is
  121. displayed. For example:
  122.  
  123.  
  124.     *arc
  125.  
  126.     Archimedes ARC - Archive utility
  127.     Usage: ARC {amufdxeplt}[bswnoi][g<password>] <archive> [<filename> . . .]
  128.     Where:   a   = add files to archive
  129.              m   = move files to archive
  130.              u   = update files in archive
  131.              f   = freshen files in archive
  132.              d   = delete files from archive
  133.              x,e = extract files from archive
  134.              p   = print file to screen
  135.              l   = listing of files in archive
  136.              t   = test archive integrity
  137.              b   = retain backup copy of archive
  138.              s   = suppress compression (store only)
  139.              w   = suppress warning messages
  140.              n   = suppress notes and comments
  141.              o   = overwrite existing files when extracting
  142.              i   = Use IBM PC Archive format
  143.              g   = Encrypt/decrypt archive entry
  144.  
  145.     Written for the Archimedes by David Pilling
  146.     Put in the Public Domain by BEEBUG  V1.00  July 1988
  147.  
  148.  
  149. Although the syntax of the ARC program may look a little frightening at first,
  150. it is really quite straightforward. Typically you will almost always use just
  151. a few of these options. The letters which appear after 'ARC', split into two
  152. groups; commands amufdxeplt and options bswnoi and g. In general, you should
  153. have just one command letter and as many options as you need. The next section
  154. looks at the commands and options.
  155. Archimedes ARC                                                          Page 4
  156.  
  157.  
  158.  
  159. 3. ARC commands
  160. ---------------
  161.  
  162.  
  163. a   = add files to archive
  164.  
  165.       This command is used to add files to an archive. If the archive does not
  166.       exist, it is automatically created. An example of this command is:
  167.  
  168.           *arc a utils_arc util1 util2 util3 util4
  169.  
  170.       This adds the files util1, util2 etc. to the archive utils_arc. You can
  171.       use wildcards in this command as follows:
  172.  
  173.           *arc a my_arc b*
  174.  
  175.       This will add all files whose names begin with 'b' to the archive. You
  176.       can use any legal filename for the name of the archive, but we recommend
  177.       that you add the suffix '_arc' to the end of the name. This will help
  178.       you identify ARC files. In addition, ARC files can also be identified by
  179.       their filetype, which is set to &DDC (Acorn approved filetype).
  180.  
  181.  
  182. m   = move files to archive
  183.  
  184.       This command is like 'a' except that the files are deleted from the
  185.       local filing system as they are added to the archive file.
  186.  
  187.  
  188. u   = update files in archive
  189.  
  190.       This only adds files to the archive if the versions on disc have a more
  191.       recent date stamp, or if they are not already in the archive. For
  192.       example:
  193.  
  194.           *arc u my_arc
  195.  
  196.       will update all files in the current directory that have been created or
  197.       changed since they were last archived.
  198.  
  199.  
  200. f   = freshen files in archive
  201.  
  202.       This is like the 'a' command, except that files are only added if they
  203.       already exist in the archive with an earlier date stamp.
  204.  
  205.  
  206. d   = delete files from archive
  207.  
  208.       This command allows you to delete files from an archive. For example:
  209.  
  210.           *arc d my_arc bob
  211.  
  212.       will remove the file bob from the archive file.
  213. Archimedes ARC                                                          Page 5
  214.  
  215.  
  216.  
  217. x,e = extract files from archive
  218.  
  219.       These two commands, remove files from an archive and create them in a
  220.       usable form on your disc. For example;
  221.  
  222.           *arc x my_arc util1
  223.  
  224.       recreates the file 'util1' from the archive. Notice that 'util1' remains
  225.       part of the archive. If you want to extract all the files, simply type:
  226.  
  227.           *arc x my_arc
  228.  
  229.  
  230. p   = print file to screen
  231.  
  232.       This is very similar to 'x' and 'e' except that the file is printed out
  233.       on the screen, instead of being sent to the filing system.
  234.  
  235.  
  236. l   = listing of files in archive
  237.  
  238.       This very useful command shows you the contents of an archive along with
  239.       much useful information. For example, to see the contents of the archive
  240.       called 'my_arc', type:
  241.  
  242.           *arc l my_arc
  243.  
  244.       You can, of course, specify individual files or groups of files using
  245.       wildcards. For example:
  246.  
  247.           *arc l my_arc pr*
  248.  
  249.       The information displayed gives the original length of the file,
  250.       and how long it is in its compressed form. The time and date stamps for
  251.       the file and information on which form of data compression has been used
  252.       to store the file. You will notice that this is preceded by either 'PC'
  253.       or 'ARC', which indicates whether the file is stored in PC or Archimedes
  254.       format.
  255.  
  256.  
  257. t   = test archive integrity
  258.  
  259.       A CRC (Cyclic Redundancy Check) is kept for each file added to the
  260.       archive, this allows ARC to tell you if a file has been corrupted. This
  261.       can happen when you are transferring files between different computers.
  262.       The 't' command unpacks all of the archive entries (without saving them
  263.       anywhere), and checks the CRC for each file against the recorded value.
  264.       It reports back to you any damage to the archive. For example, to test
  265.       that the archive 'my_arc' has been recieved correctly, type:
  266.  
  267.           *arc t my_arc
  268. Archimedes ARC                                                          Page 6
  269.  
  270.  
  271.  
  272. b   = retain backup copy of archive
  273.  
  274.       When you add a file to an archive, the original archive is renamed to
  275.       B_oldname. Normally, this is deleted after the file has been succesfully
  276.       added. By using the 'b' option, you can keep a copy of the original
  277.       archive. For example, if you wanted to add the file 'program' to the
  278.       archive 'my_arc', but want to keep a backup copy of the archive,
  279.       then type:
  280.  
  281.           *arc ab my_arc program
  282.  
  283.       The backup archive is called 'b_my_arc'.
  284.  
  285.  
  286. s   = suppress compression (store only)
  287.  
  288.       This allows you to add files to the archive without compressing them.
  289.  
  290.  
  291. w   = suppress warning messages
  292.  
  293.       This option prevents warning messages being printed.
  294.  
  295.  
  296. n   = suppress notes and comments
  297.  
  298.       This option suppresses notes and comments.
  299.  
  300.  
  301. o   = overwrite existing files when extracting
  302.  
  303.       When you extract a file, it may be that a file with the same name
  304.       already exists. Normally, you will be prompted to overwrite the file. If
  305.       you then select N, you will be prompted for permission to rename the
  306.       file. If you then select Y, ARC will pick a sensible name, but if you
  307.       select N, ARC will continue to the next file to be extracted. The 'o'
  308.       option allows you to prevent all prompting, and just overwrite existing
  309.       files. For example:
  310.  
  311.           *arc xo my_arc
  312.  
  313.  
  314. i   = Use IBM PC Archive format
  315.  
  316.       When you add a file to an archive, ARC assumes that you want the file to
  317.       be stored with its load and exec addresses and attributes. However, if
  318.       you want to give an archive to a friend with a PC, you should store the
  319.       files in PC format by adding the 'i' option to the command line. For
  320.       example, to add a PC file to an archive, type:
  321.  
  322.           *arc ai my_arc PCprog
  323. Archimedes ARC                                                          Page 7
  324.  
  325.  
  326.  
  327. g   = Encrypt/decrypt archive entry
  328.  
  329.       The 'g' (garble) option allows you to give a password which is used to
  330.       encrypt files stored in the archive. The data compression normally
  331.       applied will make files unreadable using *TYPE or *DUMP, this lets only
  332.       people who know the password extract them from the archive. For example,
  333.       if you wish to add 'newfile' to the archive 'my_arc', and encrypt it
  334.       using the password 'beebug', type:
  335.  
  336.           *arc agbeebug my_arc newfile
  337.  
  338.       When you want to extract the file again, you should type:
  339.  
  340.           *arc xgbeebug my_arc newfile
  341.  
  342.       The password can be any length, and is not case sensitive. You can if
  343.       you wish use different passwords for each file in an archive, but we
  344.       advise against it. If you should forget or mistype your password, it is
  345.       unlikely that you will ever recover the file.
  346. Archimedes ARC                                                          Page 8
  347.  
  348.  
  349.  
  350. 4. Archive file format
  351. ----------------------
  352. An Archive, is a binary file consisting of archive markers, archive headers
  353. and file data. All archives are preceded by an archive marker. This is a
  354. single byte of value 27.
  355.  
  356. An archive header, consists of several bytes.
  357.  
  358. byte  1      Header version number. This tells you how the file data is stored
  359.              and how many bytes there are in the header. The header version
  360.              numbers for the PC, are detailed below. An Archimedes header
  361.              version number is identical to the corresponding PC number except
  362.              it has bit 7 set.
  363.  
  364. bytes 2-15   Filename
  365.  
  366. bytes 16-19  Compressed file length
  367.  
  368. bytes 20,21  File date stamp
  369.  
  370. bytes 22,23  File time stamp
  371.  
  372. bytes 24,25  CRC for the file
  373.  
  374. bytes 26-29  If the header type is greater than 1, these hold the original
  375.              file length otherwise they are not present.
  376.  
  377. bytes 30-33  If bit 7 of the header version number is set, these bytes hold
  378.              the Archimedes load address for the file otherwise they are not
  379.              present.
  380.  
  381. bytes 34-37  If bit 7 of the header version number is set, these bytes hold
  382.              the Archimedes exec address for the file otherwise they are not
  383.              present.
  384.  
  385. bytes 38-41  If bit 7 of the header version number is set, these bytes hold
  386.              the Archimedes file attributes otherwise they are not present.
  387.  
  388. The archive header, is followed by the file data.
  389.  
  390. The file data is followed by another archive marker
  391.  
  392. The archive finishes with an archive marker followed by a zero byte.
  393.  
  394. The time and date fields are always filled in. If the file has a load and exec
  395. address, these are the time and date when the file was added to the archive
  396. otherwise, they are derived from the Archimedes datestamp. In all extract
  397. operations on Archimedes format archives, the contents of the load and exec
  398. fields take precedence.
  399.  
  400. PC and ARC formats may be mixed in one archive for use on the Archimedes.
  401. Archimedes ARC                                                          Page 9
  402.  
  403.  
  404.  
  405. PC ARC Header version numbers:
  406.  
  407.        1 = Old style, no compression
  408.        2 = New style, no compression
  409.        3 = Compression of repeated characters only
  410.        4 = Compression of repeated characters plus Huffman Squeezing
  411.        5 = Lempel-Zev packing of repeated strings (old style)
  412.        6 = Lempel-Zev packing of repeated strings (new style)
  413.        7 = Lempel-Zev Williams packing with improved hash function
  414.        8 = Dynamic Lempel-Zev packing with adaptive reset
  415.  
  416. The time and date stamps are two byte values from which the time in years
  417. etc., can be found as follows;
  418.  
  419.        year   = (date >> 9) & 0x7f;
  420.        month  = (date >> 5) & 0x0f;
  421.        day    = date & 0x1f;
  422.  
  423.        hour   = (time >> 11) & 0x1f;
  424.        minute = (time >> 5)  & 0x3f;
  425.        second = (time & 0x1f) * 2;
  426.  
  427. Where years are offset from 1980, months begin with 1=January.
  428. Archimedes ARC                                                          Page 10
  429.  
  430.  
  431.  
  432. 5. ARC support
  433. --------------
  434. Please send any comments or suggestions for ARC to the address below. In
  435. addition, if you would like details of the latest version of ARC and how to
  436. get hold of a copy, please contact:
  437.  
  438.     Software Manager
  439.     Beebug Ltd.
  440.     Dolphin Place,
  441.     Holywell Hill,
  442.     St. Albans,
  443.     Herts.
  444.     AL1 1EX
  445.  
  446.     Tel. (0727) 40303